package com.wu.foodsafetyplayer.utils;

import android.content.Context;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;

import com.wu.foodsafetyplayer.R;

public class AnimationUtil {
    private static AnimationSet manimationSet;
    //选中放大动画效果
    public static void setScaleAnimation(Context context,View view) {
        AnimationSet animationSet = new AnimationSet(true);
        if (manimationSet != null && manimationSet != animationSet) {
            manimationSet.setFillAfter(false);
            manimationSet.cancel();
        }
        Animation scaleAnimation = AnimationUtils.loadAnimation(context, R.anim.anim);
        animationSet.addAnimation(scaleAnimation);
        animationSet.setFillAfter(true);
        view.startAnimation(animationSet);
        manimationSet = animationSet;
    }
}
